<h1>Listing companies</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Address</th>
    <th>Contact person</th>
    <th>Contact details</th>
  </tr>

<% for company in @companies %>
  <tr>
    <td><%=h company.name %></td>
    <td><%=h company.address %></td>
    <td><%=h company.contact_person %></td>
    <td><%=h company.contact_details %></td>
    <td><%= link_to 'Show', company %></td>
    <td><%= link_to 'Edit', edit_company_path(company) %></td>
    <td><%= link_to 'Destroy', company, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New company', new_company_path %>
